/*
 * @Description: 转数组
 * @Autor: lcz
 * @Date: 2022-08-26 09:31:32
 * @LastEditors: lcz
 * @LastEditTime: 2022-08-26 09:35:30
 * @address:https://github1s.com/sindresorhus/arrify/blob/HEAD/index.js
 */
export function arrify(value: any) {
  if (value === null || value === undefined) {
    return []
  }

  if (typeof value === 'string') {
    return [value]
  }

  //迭代器 https://www.jianshu.com/p/0463d6bd8242
  if (typeof value[Symbol.iterator] === 'function') {
    return [...value]
  }

  return [value]

}